# Pydantic模型用于API响应
from typing import Optional, List

from pydantic import BaseModel

class TokenRequest(BaseModel):
    token: str

class TagModel(BaseModel):
    id: int
    name: str

class UserInfoRequest(BaseModel):
    username: str
    password:str


class UserInfoModel(BaseModel):
    id: int
    name: str
    code: str
    gender: int
    mobile: Optional[str] = None
    mail: Optional[str] = None
    avatar: Optional[str] = None
    card_photo: Optional[str] = None
    ethnic: Optional[str] = None
    ethnic_id: Optional[int] = None
    politics: Optional[int] = None
    politics_name: Optional[str] = None
    school_id: Optional[int] = None
    school_name: Optional[str] = None
    school_short_name: Optional[str] = None
    college_name: Optional[str] = None
    major_name: Optional[str] = None
    class_name: Optional[str] = None
    grade: Optional[int] = None
    score: Optional[float] = None
    hours: Optional[float] = None
    hour_unit: Optional[int] = None
    credit: Optional[float] = None
    integral: Optional[int] = None
    identity: Optional[int] = None
    status: Optional[int] = None
    is_create_activity: Optional[int] = None
    is_receive: Optional[int] = None
    is_open_honor_join_number: Optional[int] = None
    no_faith_num: Optional[int] = None
    faith_update_time: Optional[int] = None
    last_login_time: Optional[int] = None
    organization_name: Optional[str] = None
    ways_convert: Optional[int] = None
    transfer_major_status: Optional[int] = None
    transfer_major_apply_id: Optional[int] = None
    country_code: Optional[str] = None
    logo: Optional[str] = None
    app_website_nav_title: Optional[str] = None
    person_tag: Optional[List[TagModel]] = None

    class Config:
        from_attributes = True